const utils = {
  toast(title = '数据加载失败') {
    wx.showToast({
      title,
      icon: 'none',
      mask: true
    })
  },
  dateFormat(time) {
    const date = new Date(time)
    const year = date.getFullYear()
    let month = date.getMonth() + 1
    let day = date.getDate()
    //  补0
    if (month < 10) month = '0' + month
    if (day < 10) day = '0' + day
    return `${year}/${month}/${day}`
  }
}

wx.utils = utils
export default utils 